package service.impl;

import mapper.AppInfoMapper;
import mapper.AppVersionMapper;
import org.springframework.stereotype.Service;
import pojo.AppVersion;
import service.AppVersionService;

import javax.annotation.Resource;
import java.util.List;


@Service("appVersionService")
public class AppVersionServiceImpl implements AppVersionService {

    @Resource
    private AppVersionMapper appVersionMapper;
    @Resource
    private AppInfoMapper appInfoMapper;
    //查询全部APP版本信息
    public List<AppVersion> AppVersionList(int appid){

        return appVersionMapper.AppVersionList(appid);
    }
    //添加APP版本信息
    public int AddAppVersion(AppVersion appVersion){
      appVersionMapper.AddAppVersion(appVersion);
        int infoUpdate=appInfoMapper.UpdateAppInfoversionId(appVersion.getId(),appVersion.getAppId());
        return infoUpdate;
    }
    //修改APP版本信息
    public int UpdateAppVersion(AppVersion appVersion){

       return appVersionMapper.UpdateAppVersion(appVersion);
    }
    //根据Id查询App版本信息
    public AppVersion AppVersionID(int VersionId){

        return appVersionMapper.AppVersionID(VersionId);
    }
}

